<?php
namespace app\index\model;

use think\Db;
use think\Model;

class FarmManager extends Model {
    public function __construct()
    {
    }

    public function readAllFarm(){
        return Db::query("select * from user");
    }

    public function readFarm($id){
        return Db::query("select * from user where id=".$id)[0];
    }

    public function deleteFarm($id){
        return Db::table("user")->where("id",$id)->delete();
    }

    public function createFarm($farmInfo){
        return Db::table("user")->insert($farmInfo);
    }

    public function updateFarm($id,$farmInfo){
        return Db::table("user")->where("id",$id)->update($farmInfo);
    }
}